home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 19.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-10  |  7.8 KB  |  337 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15. Quotes = '22'X
  16.     ReDraw On
  17.     RequestResponse "Do You Need Instructions?"
  18.     if rc = 0 then do
  19.         call Docs()
  20.         end    
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/135/22/120/Main Image Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40.  
  41.  
  42.     Gadget.1 = 'D/135/22/120/2nd Image Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IBType = RESULT.1
  50.            end
  51.     call GetB()
  52. end
  53. else do
  54.     Gadget.1 = 'D/135/22/120/Main Image Type/2/FRAME/SEQUENCE'
  55.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  56.     if rc ~= 0 then do
  57.         call CloseStuff()
  58.         exit 0
  59.         end
  60.     else do
  61.         IAType = RESULT.1+2
  62.            end
  63.  
  64.     call GetA()
  65.  
  66.     Gadget.1 = 'D/135/22/120/2nd Image Type/2/FRAME/SEQUENCE'
  67.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 280 60
  68.     if rc ~= 0 then do
  69.         call CloseStuff()
  70.         exit 0
  71.         end
  72.     else do
  73.         IBType = RESULT.1+2
  74.            end
  75.  
  76.     call GetB()
  77. end
  78.  
  79.     KillBrush
  80.     i = Start
  81.  
  82.     ReDraw On
  83.     LoadBuffer "VFXIFX:Images/Pics/Alphas.Pic" Force
  84.     RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  85.  
  86.     RequestFile '"Select File To Use For Alpha Template!" "VFXIFX:Images/Alphas" ""'
  87.     ALName = result
  88.  
  89.  
  90. if FlyOn = 1 then
  91.     call CloseStuff()
  92.  
  93. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  94. call writeln TempFile,PicAName
  95. call writeln TempFile,Start
  96. call writeln TempFile,End
  97. call writeln TempFile,IAType
  98. call writeln TempFile,PicBName
  99. call writeln TempFile,StartB
  100. call writeln TempFile,EndB
  101. call writeln TempFile,IBType
  102. call writeln TempFile,ALName
  103. call close TempFile
  104. exit
  105.  
  106.  
  107.  
  108. Docs:
  109.     text1 = '"This effect uses a special template thats made"'
  110.     text2 = '"out of a Black & White Image. Where White is used,"'
  111.     text3 = '"it will be replaced by the 2nd image. Shades of"'
  112.     text4 = '"grey will give you various levels of transparency."'
  113.     text5 = '"We supply a number of images, but experiment on "'
  114.     text6 = '"your own and see what you can come up with."'
  115.  
  116.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  117.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  118.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  119.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  120.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  121.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  122.     Gadget.7= 'END'
  123.     NewComplexRequest  '"Instructions For Effect #19"' Gadget 366 66
  124. return
  125.  
  126.  
  127. GetFile:
  128.     parse Arg Title, Path
  129.     Address FLY_1 SetString Path
  130.     Address FLY_1 GetFileNameNT Title
  131. return result
  132.  
  133. GetFileName: procedure  
  134.    ARG CompleteName
  135.    c = lastpos("/",CompleteName)
  136.    if c = 0 then c = lastpos(":",CompleteName)
  137.    return substr(CompleteName, c + 1)
  138.  
  139.  
  140. GetA:
  141.  if IAType = 0 then do
  142.     call Switcher(TOSW)
  143.     PicAName = GetFile("Select Flyer Clip For Main Image!  ",DriveName)
  144.     Name = GetFileName(PicAName)
  145.     if Name = "" then do
  146.         Address FLY_1 OK_TEXT " OK "
  147.         Title = "You Must Enter A Valid Clip Name To Use!"
  148.         Address FLY_1 FYINT Title
  149.         Address FLY_1 Quit
  150.         call Switcher(TOWB)
  151.         exit
  152.         end
  153.     Address FLY_1 SetFileName PicAName
  154.     Address FLY_1 GetClipLength PicAName
  155.     End = result
  156.     Start = 0
  157.     Address FLY_1 Program "5"
  158.     Address FLY_1 StartNum Start
  159.     Address FLY_1 EndNum End
  160.     Address FLY_1 CurrentNum "0"
  161.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  162.     Start = word(result,1)*2
  163.     End = word(result,2)*2
  164.     Start  = Start + 1
  165.     End = End +2
  166.     call addlib('PROJECT_REXX_PORT' , 0)
  167.     call addlib(TOASTERLIB,0)
  168.     call Switcher(TOWB)
  169.     address command "C:Wait 1"
  170.     ScreenToFront
  171.     end
  172.    if IAType = 1 then do
  173.     RequestFile '"Select Flyer Still For Main Image!"' DriveName ' '
  174.     PicAName = result
  175.     Name = GetFileName(PicAName)
  176.     if Name = "" then do
  177.         Title = "You Must Enter A Valid Name To Use!"
  178.         RequestNotify Title
  179.         if FlyOn = 1 then Address FLY_1 Quit
  180.         exit
  181.         end
  182.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  183.     End = result
  184.     Start = 1
  185.     end
  186.    if IAType = 2 then do
  187.     RequestFile '"Select FileName For Main Image!"' 'SYS:' ' '
  188.     PicAName = result
  189.     Name = GetFileName(PicAName)
  190.     if Name = "" then do
  191.         Title = "You Must Enter A Valid Name To Use!"
  192.         RequestNotify Title
  193.         if FlyOn = 1 then Address FLY_1 Quit
  194.         exit
  195.         end
  196.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  197.     End = result
  198.     Start = 1
  199.     end
  200.    if IAType = 3 then do
  201.     RequestFile '"Select BaseName For Main Image! "' 'SYS:' ' '
  202.     PicAName = result
  203.     Name = GetFileName(PicAName)
  204.     if Name = "" then do
  205.         Title = "You Must Enter A Valid Name To Use!"
  206.         RequestNotify Title
  207.         if FlyOn = 1 then Address FLY_1 Quit
  208.         exit
  209.         end
  210.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  211.     End = result
  212.     Start = 1
  213.     end
  214.     DriveName = GetPathName(PicAName)
  215.  
  216. return
  217.  
  218.  
  219. GetB:
  220.  if IBType = 0 then do
  221.     call Switcher(TOSW)
  222.     PicBName = GetFile("Select Flyer Clip For 2nd Image!  ",DriveName)
  223.     Name = GetFileName(PicBName)
  224.     if Name = "" then do
  225.         Address FLY_1 OK_TEXT " OK "
  226.         Title = "You Must Enter A Valid Clip Name To Use!"
  227.         Address FLY_1 FYINT Title
  228.         Address FLY_1 Quit
  229.         call Switcher(TOWB)
  230.         exit
  231.         end
  232.     Address FLY_1 SetFileName PicBName
  233.     Address FLY_1 GetClipLength PicBName
  234.     EndB = result
  235.     StartB = 0
  236.     Address FLY_1 Program "5"
  237.     Address FLY_1 StartNum StartB
  238.     Address FLY_1 EndNum EndB
  239.     Address FLY_1 CurrentNum "-1"
  240.     Address FLY_1 GetTimeNT "Select Frame To Start With For 2nd Image!"
  241.     StartB = word(result,1)*2
  242.     EndB = word(result,2)*2
  243.     StartB  = StartB + 1
  244.     EndB = EndB +2
  245.     call addlib('PROJECT_REXX_PORT' , 0)
  246.     call addlib(TOASTERLIB,0)
  247.     call Switcher(TOWB)
  248.     address command "C:Wait 1"
  249.     ScreenToFront
  250.     end
  251.    if IBType = 1 then do
  252.     RequestFile '"Select Flyer Still For 2nd Image!"' DriveName ' '
  253.     PicBName = result
  254.     Name = GetFileName(PicBName)
  255.     if Name = "" then do
  256.         Title = "You Must Enter A Valid Name To Use!"
  257.         RequestNotify Title
  258.         if FlyOn = 1 then Address FLY_1 Quit
  259.         exit
  260.         end
  261.     EndB = Frames
  262.     StartB = 1
  263.     end
  264.    if IBType = 2 then do
  265.     RequestFile '"Select FileName For 2nd Image!"' 'SYS:' ' '
  266.     PicBName = result
  267.     Name = GetFileName(PicBName)
  268.     if Name = "" then do
  269.         Title = "You Must Enter A Valid Name To Use!"
  270.         RequestNotify Title
  271.         if FlyOn = 1 then Address FLY_1 Quit
  272.         exit
  273.         end
  274.     EndB = Frames
  275.     StartB = 1
  276.     end
  277.    if IBType = 3 then do
  278.     RequestFile '"Select BaseName For 2nd Image! "' 'SYS:' ' '
  279.     PicBName = result
  280.     Name = GetFileName(PicBName)
  281.     if Name = "" then do
  282.         Title = "You Must Enter A Valid Name To Use!"
  283.         RequestNotify Title
  284.         if FlyOn = 1 then Address FLY_1 Quit
  285.         exit
  286.         end
  287.     EndB = Frames
  288.     StartB = 1
  289.     end
  290.  
  291. return
  292.  
  293.  
  294. CloseStuff:
  295.     Address FLY_1 Quit
  296.     call remlib('ToasterARexx.port')
  297.     call remlib('PROJECT_REXX_PORT')
  298. return
  299.  
  300.  
  301. OpenFlyStuff:
  302.     FlyOn = 1
  303.     address command "run VFXIFX:FLY" 
  304.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  305.         address command "wait 1"
  306.         end
  307.     TOASTERLIB="ToasterARexx.port"
  308.     call remlib('ToasterARexx.port')
  309.     call remlib('PROJECT_REXX_PORT')
  310.     call addlib('PROJECT_REXX_PORT' , 0)
  311.     call addlib(TOASTERLIB,0)
  312.     DriveName = FindDrive()
  313. return
  314.  
  315.  
  316. FindDrive:
  317.     address command "C:Info >RAM:DriveList"
  318.     call open TempFile,"RAM:DriveList",R
  319.     do until eof(TempFile)
  320.         line = readln(TempFile)
  321.         parse var line Drive" "Rest
  322.         if Drive = "FA0:" then 
  323.             FlyVolume = word(Rest,7)":"
  324.     end
  325.     call close TempFile
  326.     address command "Delete >NIL: RAM:DriveList"
  327. return FlyVolume
  328.  
  329. GetPathName: procedure  
  330.    parse ARG CompleteName
  331.    c = lastpos("/",CompleteName)
  332.    if c = 0 then c = lastpos(":",CompleteName)
  333.    return left(CompleteName,c)
  334.  
  335.  
  336.  
  337.